<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.js"></script>
    <title>Document</title>
  </head>
  <body>
    <span>请输入验证码</span>
    <input class="inputs" type="text" />
    <img src="captcha/" class="captcha" alt="" />
    <br />
    <button>提交</button>
    <script>
      let inputs = document.querySelector(".inputs");
      let captcha = document.querySelector(".captcha");
      captcha.addEventListener("click", () => {
        captcha.src = `/captcha?time = ${Date.now()}`;
        alert(inputs.value);
      });
    </script>
  </body>
</html>
